home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_gen / sb402.zip / SETUP.INF < prev    next >
Text File  |  1996-04-14  |  13KB  |  319 lines

  1. //
  2. // Setup Installation File
  3. // Created by Setup Builder Version 4.01.002
  4. //
  5. // Copyright ⌐ 1993 - 1996 G.Plowman
  6. //
  7. // Created: 14-04-1996 at 11:37:32
  8. //
  9. //
  10. // Setup procedure for installing/de-installing:
  11. //
  12. // SETUP / SETUP BUILDER
  13. //
  14.  
  15.  
  16. // Application Variables
  17. SET %Caption%="Setup"
  18. SET %Application%="Setup Builder"
  19. SET %InstallPath%="C:\SETUP"
  20. SET %InstallDrive%="C:"
  21. SET %IniFile%="BUILDER.INI"
  22. GetProfileString("Install", "Path", "%InstallPath%", "%IniFile%", %InstallPath%)
  23.  
  24.  
  25. // Language
  26. SetLanguage("UkEnglish")
  27.  
  28.  
  29. // Set up the backdrop text
  30. SetBackdropText(1, "|    %Application% Installation", 1, 1, 50, 255, 255, 255)
  31. SetBackdropText(2, "    Install/De-Install created using Setup Builder Version 4.01.002|    Copyright ⌐ 1993 - 1996 G.Plowman|", 0, 1, 17, 255, 255, 255)
  32.  
  33.  
  34. // Now display the appropriate backdrop
  35. GetScreenWidth(%Width%)
  36. IF %Width% == 640 ShowBackDrop("", 0, 0, 0)
  37. IF %Width% == 640 GOTO :DONEBACKDROP
  38. IF %Width% == 800 ShowBackDrop("", 0, 0, 0)
  39. IF %Width% == 800 GOTO :DONEBACKDROP
  40. IF %Width% == 1024 ShowBackDrop("", 0, 0, 0)
  41. IF %Width% == 1024 GOTO :DONEBACKDROP
  42.  
  43. // Display default backdrop if screen size not recognised
  44. ShowBackDrop("", 0, 0, 0)
  45. :DONEBACKDROP
  46.  
  47.  
  48. // Determine if s/w is already installed
  49. CheckExists("%InstallPath%DEINST.INF")
  50. SET %Installed% = %ERROR%
  51.  
  52.  
  53. // Welcome Dialog
  54. SET %Message1%="Welcome to the %Application% Installation Program."
  55. SET %Message2%="This program will install the %Application% software in the directory you specify on your hard disk."
  56. SET %Message3%="(Compuserve ID: 100105,536)||Setup is supplied with the Setup Builder|software and is the copyright of G.Plowman"
  57. DialogBox("Welcome")
  58. IF %ERROR% == IDCANCEL GOTO :EXIT
  59.  
  60.  
  61. // De-Installation option
  62. :BACK
  63. SET %Message1%="Please make a selection from the following options:"
  64. SET %Message2%="Install the %Application% software"
  65. SET %Message3%="Un-Install the %Application% software"
  66. DialogBox("DEINSTALL")
  67. IF %ERROR%==IDCANCEL GOTO :EXIT
  68. IF %ERROR%==IDBUTTON2 GOTO :DEINSTALL
  69.  
  70.  
  71. // Ask the user where to install the software
  72. // but only if the software isn't already installed
  73. IF %Installed% == TRUE GOTO :INSTALLED
  74. :RETRY
  75. SET %Message1%="The install program will copy the %Application% files into the following directory:"
  76. DialogBox("AskPath")
  77. IF %ERROR% == IDBACK GOTO :BACK
  78. IF %ERROR% == IDCANCEL GOTO :EXIT
  79. :INSTALLED
  80.  
  81.  
  82. // Check for space availability
  83. GetDiskSpace(%InstallDrive%)
  84. SET %Space% = %ERROR%
  85. IF %Space% >= 872448 GOTO :GOTSPACE
  86. MessageBox("The %Application% software requires 872448 bytes of disk space and there is only %Space% bytes free on your %InstallDrive% drive.||Do you wish to continue to install the software ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  87. IF %ERROR% == IDNO GOTO :EXIT
  88.  
  89.  
  90. :GOTSPACE
  91. // User defined code - pre file copying
  92. // Save the install version
  93. WriteProfileString("Install", "Version", "4.01.002", "%IniFile%")
  94.  
  95. // Make the temporary directory
  96. MkDir("%WindowsDirectory%TEMP")
  97. WriteProfileString("Install", "TempPath", "%WindowsDirectory%TEMP", "%IniFile%")
  98.  
  99. // Create an extra directory
  100. MkDir("%InstallPath%SAMPLES")
  101.  
  102.  
  103.  
  104. // Save the installation directory
  105. WriteProfileString("Install", "Path", "%InstallPath%", "%IniFile%")
  106.  
  107.  
  108. // De-Installation option
  109. Open("%InstallPath%DEINST.INF", 10, WRITE)
  110. WriteLine(10, "// Setup Builder generated Script file for de-installing:")
  111. WriteLine(10, "// Setup Builder")
  112. WriteLine(10, "// Do not modify^13^10")
  113.  
  114.  
  115.  
  116.  
  117. // Make sure we have Disk #1 in the drive
  118. CheckExists("%CurrentDrive%DISK01", "Please insert the diskette labelled 'DISK01'")
  119. IF %ERROR% == IDCANCEL GOTO :EXIT
  120.  
  121.  
  122. // Copy files from disk & show in gauge
  123. CopyFile(25)
  124. WriteLine(10, "Delete(^034%InstallPath%SETUP.EXE^034)")
  125. "SETUP.EXE", "%InstallPath%", "Copying: Interpreter Executable", TRUE
  126. WriteLine(10, "Delete(^034%InstallPath%INST.EXE^034)")
  127. "INST.EXE", "%InstallPath%", "Copying: Interpreter Executable", TRUE
  128. WriteLine(10, "Delete(^034%InstallPath%CLEANUP.EXE^034)")
  129. "CLEANUP.EXE", "%InstallPath%", "Copying: Interpreter Executable", TRUE
  130. WriteLine(10, "Delete(^034%InstallPath%BUILDER.EXE^034)")
  131. "BUILDER.EXE", "%InstallPath%", "Copying: Setup Builder Executable", TRUE
  132. WriteLine(10, "Delete(^034%InstallPath%BUILDER.HLP^034)")
  133. "BUILDER.HLP", "%InstallPath%", "Copying: Setup Builder Help File", TRUE
  134. WriteLine(10, "Delete(^034%InstallPath%SETUP.HLP^034)")
  135. "SETUP.HLP", "%InstallPath%", "Copying: Setup Script Language Help File", TRUE
  136. IF %Installed% == FALSE Register("%WindowsDirectory%COMPRESS.EXE")
  137. WriteLine(10, "UnRegister(^034%WindowsDirectory%COMPRESS.EXE^034)")
  138. "COMPRESS.EXE", "%WindowsDirectory%", "Copying: Compression Utility", TRUE
  139. IF %Installed% == FALSE Register("%WindowsDirectory%COMPRESS.TXT")
  140. WriteLine(10, "UnRegister(^034%WindowsDirectory%COMPRESS.TXT^034)")
  141. "COMPRESS.TXT", "%WindowsDirectory%", "Copying: Compression Utility", TRUE
  142. IF %Installed% == FALSE Register("%WindowsDirectory%DOSEXEC.PIF")
  143. WriteLine(10, "UnRegister(^034%WindowsDirectory%DOSEXEC.PIF^034)")
  144. "DOSEXEC.PIF", "%WindowsDirectory%", "Copying: PIF File", TRUE
  145. WriteLine(10, "Delete(^034%InstallPath%DIBAPI.DLL^034)")
  146. "DIBAPI.DLL", "%InstallPath%", "Copying: Dynamic Link Library", TRUE
  147. WriteLine(10, "Delete(^034%WindowsDirectory%IMPORT.INI^034)")
  148. ConfirmOverwrite("%WindowsDirectory%IMPORT.INI", "%CurrentDirectory%IMPORT.INI", "", 0, 0)
  149. IF %ERROR% == IDCANCEL GOTO :END
  150. IF %ERROR% == IDNO GOTO :OVER1
  151. "IMPORT.INI", "%WindowsDirectory%", "Copying: Third Party Components Configuration File", TRUE
  152. :OVER1
  153. WriteLine(10, "Delete(^034%InstallPath%LADMIN.EXE^034)")
  154. "LADMIN.EXE", "%InstallPath%", "Copying: License Administration Utility", TRUE
  155. WriteLine(10, "Delete(^034%InstallPath%ORDERAUS.TXT^034)")
  156. "ORDERAUS.TXT", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  157. WriteLine(10, "Delete(^034%InstallPath%ORDERUK.TXT^034)")
  158. "ORDERUK.TXT", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  159. WriteLine(10, "Delete(^034%InstallPath%COMMENTS.TXT^034)")
  160. "COMMENTS.TXT", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  161. WriteLine(10, "Delete(^034%InstallPath%INSTALL.TXT^034)")
  162. "INSTALL.TXT", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  163. WriteLine(10, "Delete(^034%InstallPath%README.TXT^034)")
  164. "README.TXT", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  165. WriteLine(10, "Delete(^034%InstallPath%FILE_ID.DIZ^034)")
  166. "FILE_ID.DIZ", "%InstallPath%", "Copying: Supporting Documentation", TRUE
  167. WriteLine(10, "Delete(^034%InstallPath%SAMPLES\SETUP.SPJ^034)")
  168. "SETUP.SPJ", "%InstallPath%SAMPLES\", "Copying: Sample Setup Project", TRUE
  169. WriteLine(10, "Delete(^034%InstallPath%SAMPLES\SAMPLE1.SPJ^034)")
  170. "SAMPLE1.SPJ", "%InstallPath%SAMPLES\", "Copying: Sample Setup Project", TRUE
  171. WriteLine(10, "Delete(^034%InstallPath%SAMPLES\SAMPLE2.INF^034)")
  172. "SAMPLE2.INF", "%InstallPath%SAMPLES\", "Copying: Sample Script Files", TRUE
  173. WriteLine(10, "Delete(^034%InstallPath%SAMPLES\SAMPLE2.INI^034)")
  174. "SAMPLE2.INI", "%InstallPath%SAMPLES\", "Copying: Sample Script Files", TRUE
  175. WriteLine(10, "Delete(^034%InstallPath%SAMPLES\DIRS.INF^034)")
  176. "DIRS.INF", "%InstallPath%SAMPLES\", "Copying: Sample Script Files", TRUE
  177. WriteLine(10, "Delete(^034%InstallPath%SAMPLES\OPTIONS.INF^034)")
  178. "OPTIONS.INF", "%InstallPath%SAMPLES\", "Copying: Sample Script Files", TRUE
  179. WriteLine(10, "Delete(^034%InstallPath%SAMPLES\INDESTAL.INF^034)")
  180. "INDESTAL.INF", "%InstallPath%SAMPLES\", "Copying: Sample Script Files", TRUE
  181.  
  182.  
  183.  
  184.  
  185. // User defined code - post file copying
  186. // License
  187. GetProfileString("License", "Registration", "", "%IniFile%", %LStr%)
  188. IF "%LStr%" != "" GOTO :GOTIT
  189. GetLicense(%License%)
  190. WriteProfileString("License", "Registration", "%License%", "%IniFile%")
  191. :GOTIT
  192.  
  193. // Tell Setup Builder where to find some files for creating install disks
  194. WriteProfileString("Executables", "Setup", "%InstallPath%setup.exe", "%IniFile%")
  195. WriteProfileString("Executables", "Inst", "%InstallPath%inst.exe", "%IniFile%")
  196. WriteProfileString("Executables", "Cleanup", "%InstallPath%cleanup.exe", "%IniFile%")
  197. WriteProfileString("Executables", "DibAPI", "%InstallPath%dibapi.dll", "%IniFile%")
  198.  
  199.  
  200. // Now setup a new program manager group and its icons
  201. MessageBox("Setup can create a Program Manager group|for the %Application% application.||Do you wish to create a Program|Manager group and icons ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  202. IF %ERROR% == IDNO GOTO :NOPMGROUP
  203.  
  204. MakeGroup("%Application%", "")
  205. MakeIcon("Setup Builder", "%InstallPath%BUILDER.EXE ")
  206. MakeIcon("Setup Builder Help", "%InstallPath%BUILDER.HLP ")
  207. MakeIcon("Setup Script Help", "%InstallPath%SETUP.HLP ")
  208. MakeIcon("License Administrator", "%InstallPath%LADMIN.EXE %IniFile%")
  209. MakeIcon("Install Notes", "%InstallPath%INSTALL.TXT ")
  210. MakeIcon("ReadMe", "%InstallPath%README.TXT ")
  211. :NOPMGROUP
  212.  
  213.  
  214. // Licensing
  215. :LICENSING
  216. IF "%IniFile%" == "" SET %IniFile%="Setup Builder.INI"
  217. SET %Message1% = "Please enter the following licensing information for the %Application% software:"
  218. DialogBox("License")
  219. IF %ERROR% == IDCANCEL GOTO :EXIT
  220.  
  221.  
  222. // User defined code - post PM group creation
  223. // Create some extra icons
  224. MakeIcon("Setup", "A:\SETUP.EXE", "%InstallPath%SETUP.EXE")
  225. MakeIcon("Install", "A:\INSTALL.EXE", "%InstallPath%SETUP.EXE")
  226.  
  227. // File association
  228. MessageBox("Setup can install a file association|for File Manager with .INF files.||Do you wish to install this association ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  229. IF %ERROR% == IDNO GOTO :NOASSOC
  230. WriteProfileString("Extensions", "inf", "%InstallPath%inst.exe ^.inf", "WIN.INI")
  231. :NOASSOC
  232.  
  233.  
  234. // Done
  235. :SUCCESS
  236. SET %Message1%="|%Application% installation has been successfully completed."
  237. SET %Message2%=""
  238. DialogBox("OkBox")
  239.  
  240.  
  241. // User defined code - installation completion
  242. MessageBox("Do you wish to view the|extra installation notes ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  243. IF %ERROR% == IDNO GOTO :NONOTES
  244.  
  245. WinExec("notepad.exe %InstallPath%README.TXT")
  246. :NONOTES
  247.  
  248. GOTO :END
  249.  
  250.  
  251. // User decided to quit
  252. :EXIT
  253. SET %Message1%="Installation has been terminated. You should re-run this installation program at a later time to install %Application%."
  254. SET %Message2%="|The %Application% software has not been installed."
  255. DialogBox("OkBox")
  256. GOTO :END
  257.  
  258.  
  259. // Error
  260. :ERROR
  261. SET %Message1%="An error occured during installation of the %Application% software."
  262. SET %Message2%="|The %Application% software has not been fully installed."
  263. DialogBox("OkBox")
  264. GOTO :END
  265.  
  266.  
  267. // De-Installation option
  268. :DEINSTALL
  269. // Check to see if the software has been installed correctly
  270. GetProfileString("Install","Path", "","%IniFile%", %InstallPath%)
  271. IF "%InstallPath%" == "" GOTO :NOTINSTALLED
  272. // Software has been installed
  273. MessageBox("The %Application% software is about to be removed from your machine.||All files, directories and the appropriate Program Manager Group will be deleted.||Are you sure you wish to continue ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  274. IF %ERROR% == IDYES GOTO :DODELETE
  275. SET %Message1% = "De-installation aborted - the %Application% software has not been deinstalled."
  276. SET %Message2% = ""
  277. DialogBox("OKBOX")
  278. GOTO :END
  279.  
  280. :DODELETE
  281. CheckExists("%InstallPath%DEINST.INF")
  282. IF %ERROR% == FALSE GOTO :NOTINSTALLED
  283. CALL "%InstallPath%DEINST.INF"
  284. Delete("%InstallPath%DEINST.INF")
  285.  
  286.  
  287. // User defined code - De-Installation option
  288. Delete("%InstallPath%SAMPLES\*.*")
  289. RmDir("%InstallPath%SAMPLES")
  290.  
  291. // Finally file manager item
  292. WriteProfileString("Extensions", "inf", "", "WIN.INI")
  293.  
  294.  
  295.  
  296. SET %Len% = Len("%InstallPath%") - 1
  297. SET %InstTemp% = Left("%InstallPath%", %Len%)
  298. RmDir("%InstTemp%")
  299. Delete("%WindowsDirectory%%IniFile%")
  300.  
  301. DeleteGroup("%Application%")
  302. SET %Message1% = "The %Application% software has been successfully de-installed."
  303. SET %Message2% = "To re-install the %Application% software you should re-run this installation program."
  304. DialogBox("OKBOX")
  305. GOTO :END
  306.  
  307. :NOTINSTALLED
  308. SET %Message1% = "The %Application% software has not been correctly installed."
  309. SET %Message2% = "The De-installation procedure is unable to de-install the %Application% software."
  310. DialogBox("OKBOX")
  311. GOTO :END
  312.  
  313.  
  314. :END
  315. // Final tidy up - close files and remove components from H/D
  316. Close()
  317. CheckExists("%CurrentDirectory%CLEANUP.EXE", "Please insert the diskette labelled 'DISK01'")
  318. IF %ERROR% == IDOK WinExec("%CurrentDirectory%CLEANUP.EXE")
  319.